import { Toast  } from "vant";
import cTitle from "components/title";
import { scrollMixin } from "../../../utils/mixin";
export default {
  mixins: [scrollMixin], //加载更多
  data() {
    return {
      items: [],
        uid: '',
        total_page:'',
        page:1,
        xiaji_order:[
          // {
          //   title: '哈哈哈哈哈啊哈',
          //   price: 10000,
          //   order_sn: 'sn998888888888',
          //   create_time: '2024-8-27 18:00:00'
          // },
          // {
          //   title: '哈哈哈哈哈啊哈',
          //   price: 10000,
          //   order_sn: 'sn998888888888',
          //   create_time: '2024-8-27 18:00:00'
          // },
          // {
          //   title: '哈哈哈哈哈啊哈',
          //   price: 10000,
          //   order_sn: 'sn998888888888',
          //   create_time: '2024-8-27 18:00:00'
          // }
        ],
        isLoadMore: true,
    };
  },

  components: {
    cTitle
  },
  activated() {
    console.log(this.$route.params,'伙伴详情')
    this.uid = this.$route.params.uid;
    this.getData();
  },
  computed: {
   
  },
  methods: {
    directPushuser(uid){
      this.$router.push(this.fun.getUrl("yunDirectPushuser",{uid: this.uid}));
    },
    getData(){
      
        $http.get("ZhengChengYc.huoban_detail", {
            uid: this.uid,
            page: this.page,
          }, "加载中").then((res) => {
            if (res.result == 1) {
              console.log(res,'huoban_detail')
              this.items = res.data;
              this.total_page = res.data.xiaji_order.last_page;
              var nextPageData = res.data.xiaji_order.data;
              this.xiaji_order = [...this.xiaji_order, ...nextPageData];
              this.isLoadMore = true;
            }
          });
    },
    //获取更多数据
    getMoreData() {
      console.log("伙伴详情", this.isLoadMore);
      if (!this.isLoadMore) return;
      this.isLoadMore = false; // 防止多次请求分页数据
      if (this.page >= this.total_page) {
          Toast('到底了')
        return;
      } else {
        this.page += 1;
        this.getData();
      }
    },
  }
};